/*
 * RunwalkVideoAboutBox.java
 */

package com.runwalk.video.ui;

import java.awt.Window;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;

import net.miginfocom.swing.MigLayout;

import org.jdesktop.application.Action;

import com.runwalk.video.core.AppComponent;

@SuppressWarnings("serial")
@AppComponent
public class AboutDialog extends JDialog {
	
	private static final String DISMISS_ACTION = "dismiss";

    private JButton dismissButton;
	
	public AboutDialog(Window parent) {
        super(parent);
        initComponents();
        getRootPane().setDefaultButton(dismissButton);
    }

    @Action 
    public void dismiss() {
        setVisible(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
    	setLayout(new MigLayout());
        dismissButton = new javax.swing.JButton();
        
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setModal(true);
        setResizable(false);

        dismissButton.setAction(getAction(DISMISS_ACTION)); // NOI18N

        JLabel appTitleLabel = new JLabel();
        appTitleLabel.setFont(appTitleLabel.getFont().deriveFont(appTitleLabel.getFont().getStyle() | java.awt.Font.BOLD, appTitleLabel.getFont().getSize()+4));
        appTitleLabel.setText(getResourceMap().getString("Application.name")); // NOI18N
        add(appTitleLabel, "wrap");
        
        JLabel versionLabel = new JLabel();
        versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() | java.awt.Font.BOLD));
        versionLabel.setText(getResourceMap().getString("versionLabel.text")); // NOI18N
        add(versionLabel);

        JLabel appVersionLabel = new JLabel();
        appVersionLabel.setText(getResourceMap().getString("Application.version")); // NOI18N
        add(appVersionLabel, "wrap");

        JLabel vendorLabel = new JLabel();
        vendorLabel.setFont(vendorLabel.getFont().deriveFont(vendorLabel.getFont().getStyle() | java.awt.Font.BOLD));
        vendorLabel.setText(getResourceMap().getString("vendorLabel.text")); // NOI18N
        add(vendorLabel);
        
        JLabel appVendorLabel = new JLabel();
        appVendorLabel.setText(getResourceMap().getString("Application.vendor")); // NOI18N
        add(appVendorLabel, "wrap");

        JLabel homepageLabel = new JLabel();
        homepageLabel.setFont(homepageLabel.getFont().deriveFont(homepageLabel.getFont().getStyle() | java.awt.Font.BOLD));
        homepageLabel.setText(getResourceMap().getString("homepageLabel.text")); // NOI18N
        add(homepageLabel);

        JLabel appHomepageLabel = new JLabel();
        appHomepageLabel.setText(getResourceMap().getString("Application.homepage")); // NOI18N
        add(appHomepageLabel, "wrap");
        
        JLabel appDescLabel = new JLabel();
        appDescLabel.setText(getResourceMap().getString("appDescLabel.text")); // NOI18N
        add(appDescLabel, "wrap, span, align center");
        
        JLabel imageLabel = new JLabel();
        imageLabel.setIcon(getResourceMap().getIcon("imageLabel.icon")); // NOI18N
        add(imageLabel, "wrap, span, align center");

        add(dismissButton, "span, align center");
        pack();
    }
    
}
